package com.ray.pojo;

public class Student
{
    private String name;
    private int age;

    // 引用类型
    private School school;

    public Student()
    {
        System.out.println("Student类的无参构造方法执行了....");
    }

    public Student(String name, int age, School school)
    {
        System.out.println("Student的有参构造方法执行了...");
        this.name = name;
        this.age = age;
        this.school = school;
    }

    public void setName(String name)
    {
        System.out.println("setName == " + name);
        this.name = name;
    }

    public void setAge(int age)
    {
        System.out.println("setAge == " + age);
        this.age = age;
    }

    public void setSchool(School school)
    {
        System.out.println("setSchool == " + school);
        this.school = school;
    }

    public School getSchool()
    {
        return school;
    }

    @Override
    public String toString()
    {
        return "Student{" + "name='" + name + '\'' + ", age=" + age + ", school=" + school + '}';
    }
}
